﻿<div class="modal-header">
    <h3 class="modal-title">标签集合</h3>
</div>
<div class="modal-body">
    <form class="form-horizontal">
        <div class="col-lg-7 clear-padding">
            <div ce-enter="search" class="input-group">
                <input type="text" class="form-control" ng-model="SearchName" placeholder="搜索关键词：标签Id、标签名称、排序数字">
                <span class="input-group-btn">
                    <button class="btn btn-default" ng-click="find()" type="button">搜索</button>
                </span>
            </div>
        </div>
    </form><br/><br/>
    <table class="table table-hover table-bordered" m-check>
        <thead>
        <tr>
            <th>Id</th>
            <th>名称</th>
            <th>相关视频（个）</th>
            <th>排序数字</th>
            <th>标签别名</th>
            <th>PC显示</th>
            <th>APP显示</th>
            <th class="col-sm-3"><button ng-click="create()" class="btn btn-primary btn-xs">添加标签</button></th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="item in list">
            <td ng-if="!item.isModified">{{item.Id}}</td>
            <td ng-if="item.isModified">{{item.Id<=0?'0':item.Id}}</td>
            <td ng-if="!item.isModified">{{item.Name}}</td>
            <td ng-if="item.isModified">
                <input type="text" class="form-control" ng-model="item.Name"/>
            </td>
            <td ng-if="!item.isModified">{{item.Number<=0?'0':item.Number}}</td>
            <td ng-if="item.isModified">{{item.Number<=0?'0':item.Number}}</td>
            <td ng-if="!item.isModified">{{item.Sort}}</td>
            <td ng-if="item.isModified"><input type="number" class="form-control" ng-model="item.Sort"/></td>
            <td ng-if="!item.isModified">{{item.Alias}}</td>
            <td ng-if="item.isModified"><input type="text" class="form-control" ng-model="item.Alias" /></td>
            <td><input ng-change="chkboxChange(item,1,item.ShowPc)" type="checkbox" class="checkbox" ng-model="item.ShowPc"/></td>
            <td><input ng-change="chkboxChange(item,2,item.ShowMobile)" type="checkbox" class="checkbox" ng-model="item.ShowMobile"/></td>
            <td ng-if="!item.isModified">
                <button type="button" ng-click="remove(item)" class="btn btn-danger btn-xs">删除</button>
                <button type="button" ng-click="edit(item)" class="btn btn-success btn-xs">编辑</button>
            </td>
            <td ng-if="item.isModified">
                <button type="button" ng-click="cancel(item)" class="btn btn-danger btn-xs">取消</button>
                <button type="button" ng-click="save(item)" class="btn btn-success btn-xs">保存</button>
            </td>
        </tr>
        </tbody>
        <tfoot ng-show="!loadingState">
        <tr>
            <td colspan="8">
                <div class="pull-right">
                    <div class="pagination-info"><span class="ng-binding">共有{{total}}条</span>， <span class="ng-binding">每页显示：{{size}}条</span></div>
                    <uib-pagination boundary-links="true" total-items="total" ng-model="current" max-size="10" ng-change="search(true)" items-per-page="10"
                                    class="pagination-sm" previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
                </div>
            </td>
        </tr>
        </tfoot>
    </table>
</div>
<div class="modal-footer">
    <button class="btn btn-danger" ng-click="close()">关闭窗口</button>
</div>